import { createBrowserRouter } from "react-router-dom";
import { lazy } from "react";
import App from "@/App";

const router = createBrowserRouter(
    [
        {
            path: "/",
            Component: App,
            children: [
                {
                    path: "/",
                    Component: lazy(() => import("@pages/home")),
                },
                {
                    path: "/about",
                    Component: lazy(() => import("@pages/about")),
                },
            ],
        },
    ],
    {
        future: {
            v7_relativeSplatPath: true,
            v7_fetcherPersist: true,
            v7_normalizeFormMethod: true,
            v7_partialHydration: true,
            v7_skipActionErrorRevalidation: true,
        },
    }
);

export default router;
